/**
 @Name：Kz.layedit 富文本编辑器
 @Author：贤心
 @Modifier:KnifeZ
 @License：MIT
 @Version: V18.11.29
 */

"use strict";

function AddCustomThemes(t, e, i) {
    var n = [];
    return layui.each(t, function (t, l) {
        n.push('<option value="' + e[t] + '"  data-img="' + i[t] + '">' + l + "</option>")
    }), ['<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label">主题选择</label>', '<div class="layui-input-block">', '<select name="theme" style="display:block;height:38px;width:100%;">' + n.join("") + "</select>", "</div>", "</li>"].join("")
}

function style_html(t, e, i, n) {
    function l() {
        return this.pos = 0, this.token = "", this.current_mode = "CONTENT", this.tags = {
            parent: "parent1",
            parentcount: 1,
            parent1: ""
        }, this.tag_type = "", this.token_text = this.last_token = this.last_text = this.token_type = "", this.Utils = {
            whitespace: "\n\r\t ".split(""),
            single_token: "br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed".split(","),
            extra_liners: "head,body,/html".split(","),
            in_array: function (t, e) {
                for (var i = 0; i < e.length; i++) if (t === e[i]) return !0;
                return !1
            }
        }, this.get_content = function () {
            for (var t = "", e = [], i = !1; "<" !== this.input.charAt(this.pos);) {
                if (this.pos >= this.input.length) return e.length ? e.join("") : ["", "TK_EOF"];
                if (t = this.input.charAt(this.pos), this.pos++ , this.line_char_count++ , this.Utils.in_array(t, this.Utils.whitespace)) e.length && (i = !0), this.line_char_count--; else {
                    if (i) {
                        if (this.line_char_count >= this.max_char) {
                            e.push("\n");
                            for (var n = 0; n < this.indent_level; n++) e.push(this.indent_string);
                            this.line_char_count = 0
                        } else e.push(" "), this.line_char_count++;
                        i = !1
                    }
                    e.push(t)
                }
            }
            return e.length ? e.join("") : ""
        }, this.get_script = function () {
            var t = "", e = [], i = new RegExp("<\/script>", "igm");
            i.lastIndex = this.pos;
            for (var n = i.exec(this.input), l = n ? n.index : this.input.length; this.pos < l;) {
                if (this.pos >= this.input.length) return e.length ? e.join("") : ["", "TK_EOF"];
                t = this.input.charAt(this.pos), this.pos++ , e.push(t)
            }
            return e.length ? e.join("") : ""
        }, this.record_tag = function (t) {
            this.tags[t + "count"] ? (this.tags[t + "count"]++ , this.tags[t + this.tags[t + "count"]] = this.indent_level) : (this.tags[t + "count"] = 1, this.tags[t + this.tags[t + "count"]] = this.indent_level), this.tags[t + this.tags[t + "count"] + "parent"] = this.tags.parent, this.tags.parent = t + this.tags[t + "count"]
        }, this.retrieve_tag = function (t) {
            if (this.tags[t + "count"]) {
                for (var e = this.tags.parent; e && t + this.tags[t + "count"] !== e;) e = this.tags[e + "parent"];
                e && (this.indent_level = this.tags[t + this.tags[t + "count"]], this.tags.parent = this.tags[e + "parent"]), delete this.tags[t + this.tags[t + "count"] + "parent"], delete this.tags[t + this.tags[t + "count"]], 1 == this.tags[t + "count"] ? delete this.tags[t + "count"] : this.tags[t + "count"]--
            }
        }, this.get_tag = function () {
            var t = "", e = [], i = !1;
            do {
                if (this.pos >= this.input.length) return e.length ? e.join("") : ["", "TK_EOF"];
                t = this.input.charAt(this.pos), this.pos++ , this.line_char_count++ , this.Utils.in_array(t, this.Utils.whitespace) ? (i = !0, this.line_char_count--) : ("'" !== t && '"' !== t || e[1] && "!" === e[1] || (t += this.get_unformatted(t), i = !0), "=" === t && (i = !1), e.length && "=" !== e[e.length - 1] && ">" !== t && i && (this.line_char_count >= this.max_char ? (this.print_newline(!1, e), this.line_char_count = 0) : (e.push(" "), this.line_char_count++), i = !1), e.push(t))
            } while (">" !== t);
            var n, l = e.join("");
            n = -1 != l.indexOf(" ") ? l.indexOf(" ") : l.indexOf(">");
            var a = l.substring(1, n).toLowerCase();
            if ("/" === l.charAt(l.length - 2) || this.Utils.in_array(a, this.Utils.single_token)) this.tag_type = "SINGLE"; else if ("script" === a) this.record_tag(a), this.tag_type = "SCRIPT"; else if ("style" === a) this.record_tag(a), this.tag_type = "STYLE"; else if ("!" === a.charAt(0)) if (-1 != a.indexOf("[if")) {
                if (-1 != l.indexOf("!IE")) {
                    var o = this.get_unformatted("--\x3e", l);
                    e.push(o)
                }
                this.tag_type = "START"
            } else if (-1 != a.indexOf("[endif")) this.tag_type = "END", this.unindent(); else if (-1 != a.indexOf("[cdata[")) {
                var o = this.get_unformatted("]]>", l);
                e.push(o), this.tag_type = "SINGLE"
            } else {
                var o = this.get_unformatted("--\x3e", l);
                e.push(o), this.tag_type = "SINGLE"
            } else "/" === a.charAt(0) ? (this.retrieve_tag(a.substring(1)), this.tag_type = "END") : (this.record_tag(a), this.tag_type = "START"), this.Utils.in_array(a, this.Utils.extra_liners) && this.print_newline(!0, this.output);
            return e.join("")
        }, this.get_unformatted = function (t, e) {
            if (e && -1 != e.indexOf(t)) return "";
            var i = "", n = "", l = !0;
            do {
                if (i = this.input.charAt(this.pos), this.pos++ , this.Utils.in_array(i, this.Utils.whitespace)) {
                    if (!l) {
                        this.line_char_count--;
                        continue
                    }
                    if ("\n" === i || "\r" === i) {
                        n += "\n";
                        for (var a = 0; a < this.indent_level; a++) n += this.indent_string;
                        l = !1, this.line_char_count = 0;
                        continue
                    }
                }
                n += i, this.line_char_count++ , l = !0
            } while (-1 == n.indexOf(t));
            return n
        }, this.get_token = function () {
            var t;
            if ("TK_TAG_SCRIPT" === this.last_token) {
                var e = this.get_script();
                return "string" != typeof e ? e : (t = js_beautify(e, this.indent_size, this.indent_character, this.indent_level), [t, "TK_CONTENT"])
            }
            if ("CONTENT" === this.current_mode) return t = this.get_content(), "string" != typeof t ? t : [t, "TK_CONTENT"];
            if ("TAG" === this.current_mode) {
                if ("string" != typeof (t = this.get_tag())) return t;
                return [t, "TK_TAG_" + this.tag_type]
            }
        }, this.printer = function (t, e, i, n) {
            this.input = t || "", this.output = [], this.indent_character = e || " ", this.indent_string = "", this.indent_size = i || 2, this.indent_level = 0, this.max_char = n || 7e3, this.line_char_count = 0;
            for (var l = 0; l < this.indent_size; l++) this.indent_string += this.indent_character;
            this.print_newline = function (t, e) {
                if (this.line_char_count = 0, e && e.length) {
                    if (!t) for (; this.Utils.in_array(e[e.length - 1], this.Utils.whitespace);) e.pop();
                    e.push("\n");
                    for (var i = 0; i < this.indent_level; i++) e.push(this.indent_string)
                }
            }, this.print_token = function (t) {
                this.output.push(t)
            }, this.indent = function () {
                this.indent_level++
            }, this.unindent = function () {
                this.indent_level > 0 && this.indent_level--
            }
        }, this
    }

    var l, a;
    a = new l, a.printer(t, i, e);
    for (var o = !0; ;) {
        var s = a.get_token();
        if (a.token_text = s[0], a.token_type = s[1], "TK_EOF" === a.token_type) break;
        switch (a.token_type) {
            case "TK_TAG_START":
            case "TK_TAG_SCRIPT":
            case "TK_TAG_STYLE":
                a.print_newline(!1, a.output), a.print_token(a.token_text), a.indent(), a.current_mode = "CONTENT";
                break;
            case "TK_TAG_END":
                o && a.print_newline(!0, a.output), a.print_token(a.token_text), a.current_mode = "CONTENT", o = !0;
                break;
            case "TK_TAG_SINGLE":
                a.print_newline(!1, a.output), a.print_token(a.token_text), a.current_mode = "CONTENT";
                break;
            case "TK_CONTENT":
                "" !== a.token_text && (o = !1, a.print_token(a.token_text)), a.current_mode = "TAG"
        }
        a.last_token = a.token_type, a.last_text = a.token_text
    }
    return a.output.join("")
}

function js_beautify(t, e, i, n) {
    function l() {
        for (; h.length && (" " === h[h.length - 1] || h[h.length - 1] === T);) h.pop()
    }

    function a(t) {
        if (t = void 0 === t || t, l(), h.length) {
            "\n" === h[h.length - 1] && t || h.push("\n");
            for (var e = 0; e < n; e++) h.push(T)
        }
    }

    function o() {
        var t = h.length ? h[h.length - 1] : " ";
        " " !== t && "\n" !== t && t !== T && h.push(" ")
    }

    function s() {
        h.push(m)
    }

    function d() {
        n++
    }

    function r() {
        n && n--
    }

    function c(t) {
        _.push(b), b = t
    }

    function u() {
        L = "DO_BLOCK" === b, b = _.pop()
    }

    function p(t, e) {
        for (var i = 0; i < e.length; i++) if (e[i] === t) return !0;
        return !1
    }

    function f() {
        var t = 0, e = "";
        do {
            if (A >= y.length) return ["", "TK_EOF"];
            e = y.charAt(A), A += 1, "\n" === e && (t += 1)
        } while (p(e, k));
        if (t > 1) for (var i = 0; i < 2; i++) a(0 === i);
        var n = 1 === t;
        if (p(e, w)) {
            if (A < y.length) for (; p(y.charAt(A), w) && (e += y.charAt(A), (A += 1) !== y.length);) ;
            if (A !== y.length && e.match(/^[0-9]+[Ee]$/) && "-" === y.charAt(A)) {
                A += 1;
                return e += "-" + f(A)[0], [e, "TK_WORD"]
            }
            return "in" === e ? [e, "TK_OPERATOR"] : [e, "TK_WORD"]
        }
        if ("(" === e || "[" === e) return [e, "TK_START_EXPR"];
        if (")" === e || "]" === e) return [e, "TK_END_EXPR"];
        if ("{" === e) return [e, "TK_START_BLOCK"];
        if ("}" === e) return [e, "TK_END_BLOCK"];
        if (";" === e) return [e, "TK_END_COMMAND"];
        if ("/" === e) {
            var l = "";
            if ("*" === y.charAt(A)) {
                if ((A += 1) < y.length) for (; ("*" !== y.charAt(A) || !y.charAt(A + 1) || "/" !== y.charAt(A + 1)) && A < y.length && (l += y.charAt(A), !((A += 1) >= y.length));) ;
                return A += 2, ["/*" + l + "*/", "TK_BLOCK_COMMENT"]
            }
            if ("/" === y.charAt(A)) {
                for (l = e; "\r" !== y.charAt(A) && "\n" !== y.charAt(A) && (l += y.charAt(A), !((A += 1) >= y.length));) ;
                return A += 1, n && a(), [l, "TK_COMMENT"]
            }
        }
        if ("'" === e || '"' === e || "/" === e && ("TK_WORD" === g && "return" === v || "TK_START_EXPR" === g || "TK_END_BLOCK" === g || "TK_OPERATOR" === g || "TK_EOF" === g || "TK_END_COMMAND" === g)) {
            var o = e, s = !1;
            if (e = "", A < y.length) for (; (s || y.charAt(A) !== o) && (e += y.charAt(A), s = !s && "\\" === y.charAt(A), !((A += 1) >= y.length));) ;
            return A += 1, "TK_END_COMMAND" === g && a(), [o + e + o, "TK_STRING"]
        }
        if (p(e, E)) {
            for (; A < y.length && p(e + y.charAt(A), E) && (e += y.charAt(A), !((A += 1) >= y.length));) ;
            return [e, "TK_OPERATOR"]
        }
        return [e, "TK_UNKNOWN"]
    }

    var y, h, m, g, v, x, b, _, T, k, w, E, A, C, N, K, O, L, I, R;
    for (i = i || " ", e = e || 4, T = ""; e--;) T += i;
    for (y = t, x = "", g = "TK_START_EXPR", v = "", h = [], L = !1, I = !1, R = !1, k = "\n\r\t ".split(""), w = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split(""), E = "+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |=".split(" "), C = "continue,try,throw,return,var,if,switch,case,default,for,while,break,function".split(","), b = "BLOCK", _ = [b], n = n || 0, A = 0, N = !1; ;) {
        var S = f(A);
        if (m = S[0], "TK_EOF" === (O = S[1])) break;
        switch (O) {
            case "TK_START_EXPR":
                I = !1, c("EXPRESSION"), "TK_END_EXPR" === g || "TK_START_EXPR" === g || ("TK_WORD" !== g && "TK_OPERATOR" !== g ? o() : p(x, C) && "function" !== x && o()), s();
                break;
            case "TK_END_EXPR":
                s(), u();
                break;
            case "TK_START_BLOCK":
                c("do" === x ? "DO_BLOCK" : "BLOCK"), "TK_OPERATOR" !== g && "TK_START_EXPR" !== g && ("TK_START_BLOCK" === g ? a() : o()), s(), d();
                break;
            case "TK_END_BLOCK":
                "TK_START_BLOCK" === g ? (l(), r()) : (r(), a()), s(), u();
                break;
            case "TK_WORD":
                if (L) {
                    o(), s(), o();
                    break
                }
                if ("case" === m || "default" === m) {
                    ":" === v ? function () {
                        h.length && h[h.length - 1] === T && h.pop()
                    }() : (r(), a(), d()), s(), N = !0;
                    break
                }
                K = "NONE", "TK_END_BLOCK" === g ? p(m.toLowerCase(), ["else", "catch", "finally"]) ? (K = "SPACE", o()) : K = "NEWLINE" : "TK_END_COMMAND" !== g || "BLOCK" !== b && "DO_BLOCK" !== b ? "TK_END_COMMAND" === g && "EXPRESSION" === b ? K = "SPACE" : "TK_WORD" === g ? K = "SPACE" : "TK_START_BLOCK" === g ? K = "NEWLINE" : "TK_END_EXPR" === g && (o(), K = "NEWLINE") : K = "NEWLINE", "TK_END_BLOCK" !== g && p(m.toLowerCase(), ["else", "catch", "finally"]) ? a() : p(m, C) || "NEWLINE" === K ? "else" === v ? o() : ("TK_START_EXPR" !== g && "=" !== v || "function" !== m) && ("TK_WORD" !== g || "return" !== v && "throw" !== v ? "TK_END_EXPR" !== g ? "TK_START_EXPR" === g && "var" === m || ":" === v || ("if" === m && "TK_WORD" === g && "else" === x ? o() : a()) : p(m, C) && ")" !== v && a() : o()) : "SPACE" === K && o(), s(), x = m, "var" === m && (I = !0, R = !1);
                break;
            case "TK_END_COMMAND":
                s(), I = !1;
                break;
            case "TK_STRING":
                "TK_START_BLOCK" === g || "TK_END_BLOCK" === g ? a() : "TK_WORD" === g && o(), s();
                break;
            case "TK_OPERATOR":
                var z = !0, D = !0;
                if (I && "," !== m && (R = !0, ":" === m && (I = !1)), ":" === m && N) {
                    s(), a();
                    break
                }
                if (N = !1, "," === m) {
                    I ? R ? (s(), a(), R = !1) : (s(), o()) : "TK_END_BLOCK" === g ? (s(), a()) : "BLOCK" === b ? (s(), a()) : (s(), o());
                    break
                }
                "--" === m || "++" === m ? ";" === v ? (z = !0, D = !1) : (z = !1, D = !1) : "!" === m && "TK_START_EXPR" === g ? (z = !1, D = !1) : "TK_OPERATOR" === g ? (z = !1, D = !1) : "TK_END_EXPR" === g ? (z = !0, D = !0) : "." === m ? (z = !1, D = !1) : ":" === m && (z = !!v.match(/^\d+$/)), z && o(), s(), D && o();
                break;
            case "TK_BLOCK_COMMENT":
                a(), s(), a();
                break;
            case "TK_COMMENT":
                o(), s(), a();
                break;
            case "TK_UNKNOWN":
                s()
        }
        g = O, v = m
    }
    return h.join("")
}

layui.define(["layer", "form"], function (t) {
    var e = function (t) {
            var e = t.originalEvent.changedTouches[0];
            return document.elementFromPoint(e.clientX, e.clientY)
        }, i = layui.$, n = layui.layer, l = layui.form, a = (layui.hint(), layui.device()), o = "layui-disabled",
        s = function () {
            var t = this;
            t.index = 0, t.config = {
                tool: ["strong", "italic", "underline", "del", "|", "left", "center", "right", "|", "link", "unlink", "face", "image"],
                uploadImage: {
                    url: "",
                    field: "file",
                    accept: "image",
                    acceptMime: "image/*",
                    exts: "jpg|png|gif|bmp|jpeg",
                    size: 10240,
                    done: function (t) {
                    }
                },
                uploadVideo: {
                    url: "",
                    field: "file",
                    accept: "video",
                    acceptMime: "video/*",
                    exts: "mp4|flv|avi|rm|rmvb",
                    size: 20480,
                    done: function (t) {
                    }
                },
                calldel: {
                    url: "", done: function (t) {
                    }
                },
                quote: {style: [], js: []},
                customTheme: {video: {title: [], content: [], preview: []}},
                customlink: {title: "自定义链接", href: "", onmouseup: ""},
                devmode: !1,
                hideTool: [],
                height: 280
            }
        };
    s.prototype.set = function (t) {
        var e = this;
        return i.extend(!0, e.config, t), e
    }, s.prototype.on = function (t, e) {
        return layui.onevent("layedit", t, e)
    }, s.prototype.build = function (t, e) {
        e = e || {};
        var n = this, l = n.config, o = "layui-layedit", s = i("string" == typeof t ? "#" + t : t),
            r = "LAY_layedit_" + ++n.index, c = s.next("." + o), u = i.extend({}, l, e), p = function () {
                var t = [], e = {};
                return layui.each(u.hideTool, function (t, i) {
                    e[i] = !0
                }), layui.each(u.tool, function (i, n) {
                    A[n] && !e[n] && t.push(A[n])
                }), t.join("")
            }(),
            f = i(['<div class="' + o + '">', '<div class="layui-unselect layui-layedit-tool">' + p + "</div>", '<div class="layui-layedit-iframe">', '<iframe id="' + r + '" name="' + r + '" textarea="' + t + '" frameborder="0"></iframe>', "</div>", "</div>"].join(""));
        return a.ie && a.ie < 8 ? s.removeClass("layui-hide").addClass("layui-show") : (c[0] && c.remove(), d.call(n, f, s[0], u), s.addClass("layui-hide").after(f), n.index)
    }, s.prototype.getContent = function (t) {
        var e = r(t);
        if (e[0]) return c(e[0].document.body.innerHTML)
    }, s.prototype.getText = function (t) {
        var e = r(t);
        if (e[0]) return i(e[0].document.body).text()
    }, s.prototype.setContent = function (t, e, n) {
        var l = r(t);
        l[0] && (n ? i(l[0].document.body).append(e) : i(l[0].document.body).html(e), this.sync(t))
    }, s.prototype.sync = function (t) {
        var e = r(t);
        if (e[0]) {
            i("#" + e[1].attr("textarea")).val(c(e[0].document.body.innerHTML))
        }
    }, s.prototype.getSelection = function (t) {
        var e = r(t);
        if (e[0]) {
            var i = f(e[0].document);
            return document.selection ? i.text : i.toString()
        }
    };
    var d = function (t, e, n) {
        var l = this, a = t.find("iframe");
        a.css({height: n.height}).on("load", function () {
            var o = a.contents(), s = a.prop("contentWindow"), d = o.find("head"),
                r = i(["<style>", "*{margin: 0; padding: 0;}", "body{padding: 10px; line-height: 20px; overflow-x: hidden; word-wrap: break-word; font: 14px Helvetica Neue,Helvetica,PingFang SC,Microsoft YaHei,Tahoma,Arial,sans-serif; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}", "a{color:#01AAED; text-decoration:none;}a:hover{color:#c00}", "p{margin-bottom: 10px;}", "video{max-width:400px;}", "td{border: 1px solid #DDD;width:80px}", "table{border-collapse: collapse;}", 'a[name]:before{content:"§";color: #01aaed;font-weight: bold;}', "img{display: inline-block; border: none; vertical-align: middle;}", "pre{margin: 10px 0; padding: 10px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}", "</style>"].join("")),
                c = o.find("body"), p = function () {
                    var t = [];
                    return layui.each(n.quote.style, function (e, i) {
                        t.push('<link href="' + i + '" rel="stylesheet"/>')
                    }), layui.each(n.quote.js, function (e, i) {
                        t.push('<script src="' + i + '"><\/script>')
                    }), t.join("")
                }();
            d.append(r), d.append(p), c.attr("contenteditable", "true").css({"min-height": n.height}).html(e.value || ""), u.apply(l, [s, a, e, n]), g.call(l, s, t, n)
        })
    }, r = function (t) {
        var e = i("#LAY_layedit_" + t);
        return [e.prop("contentWindow"), e]
    }, c = function (t) {
        return 8 == a.ie && (t = t.replace(/<.+>/g, function (t) {
            return t.toLowerCase()
        })), t
    }, u = function (t, e, l, o) {
        var s = t.document, d = i(s.body);
        d.on("keydown", function (t) {
            if (13 === t.keyCode) {
                var e = f(s), i = y(e), l = i.parentNode;
                if ("pre" === l.tagName.toLowerCase()) {
                    if (t.shiftKey) return;
                    return n.msg("请暂时用shift+enter"), !1
                }
                "body" === l.tagName.toLowerCase() && s.execCommand("formatBlock", !1, "<p>")
            }
        }), i(l).parents("form").on("submit", function () {
            var t = d.html();
            8 == a.ie && (t = t.replace(/<.+>/g, function (t) {
                return t.toLowerCase()
            })), l.value = t
        }), d.on("paste", function (e) {
            s.execCommand("formatBlock", !1, "<p>"), setTimeout(function () {
                p.call(t, d), l.value = d.html()
            }, 100)
        })
    }, p = function (t) {
        var e = this;
        e.document;
        t.find("*[style]").each(function () {
            var t = this.style.textAlign;
            this.removeAttribute("style"), i(this).css({"text-align": t || ""})
        }), t.find("script,link").remove()
    }, f = function (t) {
        return t.selection ? t.selection.createRange() : t.getSelection().getRangeAt(0)
    }, y = function (t) {
        return t.endContainer || t.parentElement().childNodes[0]
    }, h = function (t, e, i) {
        var l = (this.document, document.createElement(t));
        for (var o in e) l.setAttribute(o, e[o]);
        if (l.removeAttribute("text"), a.ie) {
            var s = i.text || e.text;
            if ("a" === t && !s) return;
            s && (l.innerHTML = s), n.msg("暂不支持IE浏览器"), i.selectNode(this.document.body.childNodes.item(0)), i.insertNode(l)
        } else {
            var s = i.toString() || e.text;
            if ("a" === t && !s) return;
            s && (l.innerHTML = s), i.deleteContents(), i.insertNode(l)
        }
    }, m = function (t, e) {
        var n = this.document, l = "layedit-tool-active", a = y(f(n)), s = function (e) {
            return t.find(".layedit-tool-" + e)
        };
        e && e[e.hasClass(l) ? "removeClass" : "addClass"](l), t.find(">i").removeClass(l), s("unlink").addClass(o), i(a).parents().each(function () {
            var t = this.tagName.toLowerCase(), e = this.style.textAlign;
            "p" === t && ("center" === e ? s("center").addClass(l) : "right" === e ? s("right").addClass(l) : s("left").addClass(l)), "a" === t && (s("link").addClass(l), s("unlink").removeClass(o))
        })
    }, g = function (t, e, l) {
        var s = t.document, d = i(s.body), r = {
            link: function (e) {
                var n = y(e), a = i(n).parent();
                v.call(d, {
                    href: a.attr("href"),
                    target: a.attr("target"),
                    rel: a.attr("rel"),
                    text: a.attr("text"),
                    dmode: l.devmode
                }, function (i) {
                    var n = a[0];
                    "A" === n.tagName ? (n.href = i.url, n.rel = i.rel, n.text = i.text) : h.call(t, "a", {
                        target: i.target,
                        href: i.url,
                        rel: i.rel,
                        text: i.text
                    }, e)
                })
            }, unlink: function (t) {
                s.execCommand("unlink")
            }, face: function (e) {
                T.call(this, function (i) {
                    h.call(t, "img", {src: i.src, alt: i.alt}, e), setTimeout(function () {
                        d.focus()
                    }, 100)
                })
            }, image: function (e) {
                var a = this;
                layui.use("upload", function (o) {
                    var s = l.uploadImage || {};
                    o.render({
                        url: s.url,
                        field: s.field,
                        accept: s.accept,
                        acceptMime: s.acceptMime,
                        exts: s.exts,
                        size: s.size,
                        elem: i(a).find("input")[0],
                        done: function (i) {
                            0 == i.code ? (i.data = i.data || {}, h.call(t, "img", {
                                src: i.data.src,
                                alt: i.data.title
                            }, e), s.done(i), setTimeout(function () {
                                d.focus()
                            }, 100)) : n.msg(i.msg || "上传失败")
                        }
                    })
                })
            }, code: function (e) {
                var i = l.codeConfig || {hide: !1};
                E.call(d, {hide: i.hide, default: i.default}, function (i) {
                    h.call(t, "pre", {text: i.code, "lay-lang": i.lang}, e), setTimeout(function () {
                        d.focus()
                    }, 100)
                })
            }, images: function (e) {
                n.open({
                    type: 1,
                    id: "fly-jie-image-upload",
                    title: "图片管理",
                    shade: .05,
                    shadeClose: !0,
                    area: function () {
                        return /mobile/i.test(navigator.userAgent) || i(window).width() <= 485 ? ["90%"] : ["485px"]
                    }(),
                    offset: function () {
                        return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
                    }(),
                    skin: "layui-layer-border",
                    content: ['<ul class="layui-form layui-form-pane" style="margin: 20px 20px 0 20px;">', '<li class="layui-form-item">', '<div class="layui-upload">', '<button type="button" class="layui-btn" id="LayEdit_InsertImages"><i class="layui-icon"></i>多图上传</button> ', '<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;min-height: 116px">', '  预览图(点击图片可删除)：<div class="layui-upload-list" id="imgsPrev"></div>', "</blockquote>", "</div>", "</li>", '<li class="layui-form-item" style="position: relative;width: 48%;display: inline-block;">', '<label class="layui-form-label" style="position: relative;z-index: 10;width: 60px;">宽度</label>', '<input type="text" required name="imgWidth" placeholder="px" style="position: absolute;width: 100%;padding-left: 70px;left: 0;top:0" value="" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative;width: 48%;display: inline-block;margin-left: 4%;">', '<label class="layui-form-label" style="width: 60px;position: relative;z-index: 10;">高度</label>', '<input type="text" required name="imgHeight" placeholder="px" style="position: absolute;width: 100%;padding-left: 70px;left: 0;top:0" value="" class="layui-input">', "</li>", "</ul>"].join(""),
                    btn: ["确定", "取消"],
                    btnAlign: "c",
                    yes: function (i, l) {
                        var a = "";
                        "" != l.find('input[name="imgWidth"]').val() && (a += "width:" + l.find('input[name="imgWidth"]').val() + "px;"), "" != l.find('input[name="imgHeight"]').val() && (a += "height:" + l.find('input[name="imgHeight"]').val() + "px;"), 0 === l.find("#imgsPrev").find("img").length ? n.msg("请选择要插入的图片") : (h.call(t, "p", {text: l.find("#imgsPrev").html().replace(new RegExp(/(max-width:70px;margin:2px)/g), a)}, e), n.close(i))
                    },
                    success: function (t, e) {
                        layui.use("upload", function () {
                            var e = layui.upload, a = l.uploadImage || {}, o = [];
                            e.render({
                                elem: "#LayEdit_InsertImages",
                                url: a.url,
                                field: a.field,
                                method: a.type,
                                accept: a.accept,
                                acceptMime: a.acceptMime,
                                exts: a.exts,
                                size: a.size,
                                multiple: !0,
                                before: function (t) {
                                    t.preview(function (t, e, n) {
                                        -1 === o.indexOf(t) && i("#imgsPrev").append('<img data-index="' + t + '" src="' + n + '" alt="' + e.name + '" style="max-width:70px;margin:2px" class="layui-upload-img">')
                                    })
                                },
                                allDone: function () {
                                    for (var t = 0; t < o.length; t++) i("#imgsPrev").find('img[data-index="' + o[t] + '"]').remove()
                                },
                                error: function (t, e) {
                                    o.push(t)
                                },
                                done: function (e, o, s) {
                                    0 == e.code ? (e.data = e.data || {}, i("#imgsPrev img:last")[0].src = e.data.src, a.done(e)) : n.msg(e.msg || "上传失败"), t.find(".layui-upload-img").on("click", function () {
                                        n.confirm("是否删除该图片?", {icon: 3, title: "提示"}, function (t) {
                                            var e = l.calldel;
                                            "" != e.url ? i.post(e.url, {imgpath: this.src}, function (t) {
                                                i("#imgsPrev img:last")[0].remove(), e.done(t)
                                            }) : (n.msg("没有配置回调参数"), i("#imgsPrev img:last")[0].remove()), n.close(t)
                                        })
                                    })
                                }
                            })
                        })
                    }
                })
            }, image_alt: function (e) {
                n.open({
                    type: 1,
                    id: "fly-jie-image-upload",
                    title: "图片管理",
                    shade: .05,
                    shadeClose: !0,
                    area: function () {
                        return /mobile/i.test(navigator.userAgent) || i(window).width() <= 485 ? ["90%"] : ["485px"]
                    }(),
                    offset: function () {
                        return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
                    }(),
                    skin: "layui-layer-border",
                    content: ['<ul class="layui-form layui-form-pane" style="margin: 20px 20px 0 20px">', '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_InsertImage" style="width: 110px;position: relative;z-index: 10;"><i class="layui-icon"></i>上传图片</button>', '<input type="text" name="Imgsrc" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">描述</label>', '<input type="text" required name="altStr" placeholder="alt属性" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">宽度</label>', '<input type="text" required name="imgWidth" placeholder="px" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">高度</label>', '<input type="text" required name="imgHeight" placeholder="px" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="" class="layui-input">', "</li>", "</ul>"].join(""),
                    btn: ["确定", "取消"],
                    btnAlign: "c",
                    yes: function (i, l) {
                        var a = "", o = l.find('input[name="altStr"]'), s = l.find('input[name="Imgsrc"]');
                        "" != l.find('input[name="imgWidth"]').val() && (a += "width:" + l.find('input[name="imgWidth"]').val() + "px;"), "" != l.find('input[name="imgHeight"]').val() && (a += "height:" + l.find('input[name="imgHeight"]').val() + "px;"), "" == s.val() ? n.msg("请选择一张图片或输入图片地址") : (h.call(t, "img", {
                            src: s.val(),
                            alt: o.val(),
                            style: a
                        }, e), n.close(i))
                    },
                    success: function (t, e) {
                        layui.use("upload", function (e) {
                            var i, e = layui.upload, a = t.find('input[name="altStr"]'),
                                o = t.find('input[name="Imgsrc"]'), s = l.uploadImage || {};
                            e.render({
                                elem: "#LayEdit_InsertImage",
                                url: s.url,
                                field: s.field,
                                accept: s.accept,
                                acceptMime: s.acceptMime,
                                exts: s.exts,
                                size: s.size,
                                before: function (t) {
                                    i = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                },
                                done: function (t, e, l) {
                                    if (n.close(i), 0 == t.code) t.data = t.data || {}, o.val(t.data.src), a.val(t.data.name), s.done(t); else if (2 == t.code) var d = n.open({
                                        type: 1,
                                        anim: 2,
                                        icon: 5,
                                        title: "提示",
                                        area: ["390px", "260px"],
                                        offset: "t",
                                        content: t.msg + "<div style='text-align:center;'><img src='" + t.data.src + "' style='max-height:80px'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                        btn: ["确定", "取消"],
                                        yes: function () {
                                            t.data = t.data || {}, o.val(t.data.src), a.val(t.data.name), n.close(d)
                                        }
                                    }); else n.msg(t.msg || "上传失败")
                                }
                            })
                        })
                    }
                })
            }, video: function (e) {
                var a = l.customTheme || {video: []}, o = "";
                a.video.title.length > 0 && (o = AddCustomThemes(a.video.title, a.video.content, a.video.preview)), n.open({
                    type: 1,
                    id: "fly-jie-video-upload",
                    title: "视频管理",
                    shade: .05,
                    shadeClose: !0,
                    area: function () {
                        return /mobile/i.test(navigator.userAgent) || i(window).width() <= 485 ? ["90%"] : ["485px"]
                    }(),
                    offset: function () {
                        return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
                    }(),
                    skin: "layui-layer-border",
                    content: ['<ul class="layui-form layui-form-pane" style="margin: 20px 20px 0 20px">', '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_InsertVideo" style="width: 110px;position: relative;z-index: 10;"> <i class="layui-icon"></i>上传视频</button>', '<input type="text" name="video" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_InsertImage" style="width: 110px;position: relative;z-index: 10;"> <i class="layui-icon"></i>上传封面</button>', '<input type="text" name="cover" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" class="layui-input">', "</li>", o, "</ul>"].join(""),
                    btn: ["确定", "取消"],
                    btnAlign: "c",
                    yes: function (i, l) {
                        var o = l.find('input[name="video"]'), s = l.find('input[name="cover"]'),
                            d = l.find('select[name="theme"]');
                        if ("" == o.val()) n.msg("请选择一个视频或输入视频地址"); else {
                            var r = '&nbsp;<video src="' + o.val() + '" poster="' + s.val() + '" controls="controls" >您的浏览器不支持video播放</video>&nbsp;',
                                c = "";
                            a.video.title.length > 0 && d.length > 0 && (c = d[0].options[d[0].selectedIndex].value), h.call(t, "div", {
                                text: r,
                                class: c
                            }, e), n.close(i)
                        }
                    },
                    success: function (t, e) {
                        layui.use("upload", function (e) {
                            var i, o = t.find('input[name="video"]'), s = t.find('input[name="cover"]'),
                                e = layui.upload, d = l.uploadImage || {}, r = l.uploadVideo || {};
                            e.render({
                                elem: "#LayEdit_InsertImage",
                                url: d.url,
                                field: d.field,
                                accept: d.accept,
                                acceptMime: d.acceptMime,
                                exts: d.exts,
                                size: d.size,
                                before: function (t) {
                                    i = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                },
                                done: function (t, e, l) {
                                    if (n.close(i), 0 == t.code) t.data = t.data || {}, s.val(t.data.src), d.done(t); else if (2 == t.code) var a = n.open({
                                        type: 1,
                                        anim: 2,
                                        icon: 5,
                                        title: "提示",
                                        area: ["390px", "260px"],
                                        offset: "t",
                                        content: t.msg + "<div><img src='" + t.data.src + "' style='max-height:100px'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                        btn: ["确定", "取消"],
                                        yes: function () {
                                            t.data = t.data || {}, s.val(t.data.src), n.close(a)
                                        }
                                    }); else n.msg(t.msg || "上传失败")
                                }
                            }), e.render({
                                elem: "#LayEdit_InsertVideo",
                                url: r.url,
                                field: r.field,
                                accept: r.accept,
                                acceptMime: r.acceptMime,
                                exts: r.exts,
                                size: r.size,
                                before: function (t) {
                                    i = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                },
                                done: function (t, e, l) {
                                    if (n.close(i), 0 == t.code) t.data = t.data || {}, o.val(t.data.src), r.done(t); else if (2 == t.code) var a = n.open({
                                        type: 1,
                                        anim: 2,
                                        icon: 5,
                                        title: "提示",
                                        area: ["390px", "260px"],
                                        offset: "t",
                                        content: t.msg + "<div><video src='" + t.data.src + "' style='max-height:100px' controls='controls'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                        btn: ["确定", "取消"],
                                        yes: function () {
                                            t.data = t.data || {}, o.val(t.data.src), n.close(a)
                                        }
                                    }); else n.msg(t.msg || "上传失败")
                                }
                            });
                            var c = t.find('select[name="theme"]');
                            a.video.title.length > 0 && c.length > 0 && t.find('select[name="theme"]').on("change mouseover", function () {
                                n.tips("<img src='" + c[0].options[c[0].selectedIndex].attributes["data-img"].value + "' />", this)
                            })
                        })
                    }
                })
            }, html: function (e) {
                var i = this, l = i.parentElement.nextElementSibling.firstElementChild.contentDocument.body.innerHTML;
                l = style_html(l, 4, " ", 80), n.open({
                    type: 1,
                    id: "knife-z-html",
                    title: "源码模式",
                    shade: .3,
                    area: ["85%", "85%"],
                    content: '<div id ="aceHtmleditor" style="width:100%;height:100%"></div>',
                    btn: ["确定", "取消"],
                    btnAlign: "c",
                    yes: function (e) {
                        var i = ace.edit("aceHtmleditor");
                        t.document.body.innerHTML = i.getValue(), n.close(e)
                    },
                    success: function (t, e) {
                        var i = ace.edit("aceHtmleditor");
                        i.setFontSize(14), i.session.setMode("ace/mode/html"), i.setTheme("ace/theme/tomorrow"), i.setValue(l), i.setOption("wrap", "free"), i.gotoLine(0)
                    }
                })
            }, fullScreen: function (t) {
                null == this.parentElement.parentElement.getAttribute("style") ? (this.parentElement.parentElement.setAttribute("style", "position: fixed;top: 0;left: 0;height: 100%;width: 100%;background-color: antiquewhite;z-index: 9999;"), this.parentElement.nextElementSibling.style = "height:100%", this.parentElement.nextElementSibling.firstElementChild.style = "height:100%") : (this.parentElement.parentElement.removeAttribute("style"), this.parentElement.nextElementSibling.removeAttribute("style"), this.parentElement.nextElementSibling.firstElementChild.style = "height:" + l.height)
            }, colorpicker: function (t) {
                k.call(this, function (t) {
                    s.execCommand("forecolor", !1, t), setTimeout(function () {
                        d.focus()
                    }, 100)
                })
            }, fontBackColor: function (t) {
                k.call(this, function (t) {
                    a.ie ? s.execCommand("backColor", !1, t) : s.execCommand("hiliteColor", !1, t), setTimeout(function () {
                        d.focus()
                    }, 100)
                })
            }, fontFomatt: function (t) {
                var e = l.fontFomatt || {
                    code: ["p", "h1", "h2", "h3", "h4", "div"],
                    text: ["正文(p)", "一级标题(h1)", "二级标题(h2)", "三级标题(h3)", "四级标题(h4)", "块级元素(div)"]
                }, i = {}, n = {}, a = e.code, o = e.text, r = function () {
                    return layui.each(a, function (t, e) {
                        i[t] = e
                    }), i
                }(), c = function () {
                    return layui.each(o, function (t, e) {
                        n[t] = e
                    }), n
                }();
                w.call(this, {fonts: r, texts: c}, function (t) {
                    s.execCommand("formatBlock", !1, "<" + t + ">"), setTimeout(function () {
                        d.focus()
                    }, 100)
                })
            }, customlink: function (e) {
                var n = y(e), a = i(n).parent();
                x.call(d, {title: l.customlink.title}, function (i) {
                    var n = a[0];
                    "A" === n.tagName ? (n.href = i.url, n.rel = i.rel) : h.call(t, "a", {
                        target: "_blank",
                        href: l.customlink.href,
                        rel: "nofollow",
                        text: i.text,
                        onmouseup: l.customlink.onmouseup
                    }, e)
                })
            }, anchors: function (e) {
                b.call(d, {}, function (i) {
                    h.call(t, "a", {name: "#" + i.text, text: " "}, e)
                })
            }, table: function (e) {
                _.call(this, function (i) {
                    for (var n = "<tr>", l = 0; l < i.cells; l++) n += "<td></td>";
                    n += "</tr>";
                    for (var a = n, l = 0; l < i.rows; l++) n += a;
                    h.call(t, "table", {text: n}, e), setTimeout(function () {
                        d.focus()
                    }, 10)
                })
            }, addhr: function (e) {
                h.call(t, "hr", {}, e)
            }, help: function () {
                n.open({
                    type: 2,
                    title: "帮助",
                    area: ["600px", "380px"],
                    shadeClose: !0,
                    shade: .1,
                    offset: "100px",
                    skin: "layui-layer-msg",
                    content: ["http://www.layui.com/about/layedit/help.html", "no"]
                })
            }
        }, c = e.find(".layui-layedit-tool"), u = function () {
            var e = i(this), n = e.attr("layedit-event"), l = e.attr("lay-command");
            if (!e.hasClass(o)) {
                d.focus();
                var a = f(s), u = a.commonAncestorContainer;
                l ? (/justifyLeft|justifyCenter|justifyRight/.test(l) && "BODY" === u.parentNode.tagName && s.execCommand("formatBlock", !1, "<p>"), s.execCommand(l), setTimeout(function () {
                    d.focus()
                }, 10)) : r[n] && r[n].call(this, a, s), m.call(t, c, e)
            }
        }, p = /image/;
        c.find(">i").on("mousedown", function () {
            var t = i(this), e = t.attr("layedit-event");
            p.test(e) || u.call(this)
        }).on("click", function () {
            var t = i(this), e = t.attr("layedit-event");
            p.test(e) && u.call(this)
        }), d.on("click", function () {
            m.call(t, c), n.close(T.index), n.close(_.index), n.close(k.index), n.close(w.index)
        });
        var g = null, A = function (e) {
            if (null != e) {
                n.close(g);
                var a, o;
                switch (a = e.target, o = a.parentNode, a.tagName) {
                    case "IMG":
                        g = n.open({
                            type: 1,
                            id: "fly-jie-image-upload",
                            title: "图片管理",
                            area: function () {
                                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 485 ? ["90%"] : ["485px"]
                            }(),
                            offset: function () {
                                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
                            }(),
                            shade: 0,
                            closeBtn: !1,
                            content: ['<ul class="layui-form layui-form-pane" style="margin: 20px 20px 0 20px">', '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_UpdateImage" style="width: 110px;position: relative;z-index: 10;"> <i class="layui-icon"></i>上传图片</button>', '<input type="text" name="Imgsrc" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="' + e.target.src + '" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">描述</label>', '<input type="text" required name="altStr" placeholder="alt属性" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="' + e.target.alt + '" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">宽度</label>', '<input type="text" required name="imgWidth" placeholder="px" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="' + (parseInt(e.target.style.width) || "") + '" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<label class="layui-form-label" style="width: 110px;position: relative;z-index: 10;">高度</label>', '<input type="text" required name="imgHeight" placeholder="px" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" value="' + (parseInt(e.target.style.height) || "") + '" class="layui-input">', "</li>", "</ul>"].join(""),
                            btn: ["确定", "取消", '<span style="color:red">删除</span>'],
                            btnAlign: "c",
                            yes: function (t, i) {
                                var l = i.find('input[name="Imgsrc"]').val(),
                                    a = i.find('input[name="imgWidth"]').val(),
                                    o = i.find('input[name="imgHeight"]').val();
                                "" == l ? n.msg("请选择一张图片或输入图片地址") : (e.target.src = l, e.target.alt = i.find('input[name="altStr"]').val(), e.target.style.width = "" != a ? a + "px" : "", e.target.style.height = "" != o ? o + "px" : "", n.close(t))
                            },
                            btn2: function (t, e) {
                            },
                            btn3: function (t, a) {
                                var o = l.calldel;
                                "" != o.url ? i.post(o.url, {imgpath: e.target.src}, function (t) {
                                    e.toElement.remove(), o.done(t)
                                }) : e.toElement.remove(), n.close(t)
                            },
                            success: function (t, e) {
                                var i = l.uploadImage || {};
                                return layui.use("upload", function (e) {
                                    var l, a = t.find('input[name="altStr"]'), o = t.find('input[name="Imgsrc"]');
                                    e = layui.upload, e.render({
                                        elem: "#LayEdit_UpdateImage",
                                        url: i.url,
                                        field: i.field,
                                        accept: i.accept,
                                        acceptMime: i.acceptMime,
                                        exts: i.exts,
                                        size: i.size,
                                        before: function (t) {
                                            l = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                        },
                                        done: function (t, e, i) {
                                            if (n.close(l), 0 == t.code) t.data = t.data || {}, o.val(t.data.src), a.val(t.data.name); else if (2 == t.code) var s = n.open({
                                                type: 1,
                                                anim: 2,
                                                icon: 5,
                                                title: "提示",
                                                area: ["390px", "260px"],
                                                offset: "t",
                                                content: t.msg + "<div style='text-align:center;'><img src='" + t.data.src + "' style='max-height:80px'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                                btn: ["确定", "取消"],
                                                yes: function () {
                                                    t.data = t.data || {}, o.val(t.data.src), a.val(t.data.name), n.close(s)
                                                }
                                            }); else n.msg(t.msg || "上传失败")
                                        }
                                    })
                                }), !1
                            }
                        });
                        break;
                    case "VIDEO":
                        var s = l.customTheme || {video: []}, d = "";
                        s.video.title.length > 0 && (d = AddCustomThemes(s.video.title, s.video.content, s.video.preview)), g = n.open({
                            type: 1,
                            id: "fly-jie-video-upload",
                            title: "视频管理",
                            shade: .05,
                            shadeClose: !0,
                            area: function () {
                                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 485 ? ["90%"] : ["485px"]
                            }(),
                            offset: function () {
                                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
                            }(),
                            skin: "layui-layer-border",
                            content: ['<ul class="layui-form layui-form-pane" style="margin: 20px 20px 0 20px">', '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_InsertVideo" style="width: 110px;position: relative;z-index: 10;"> <i class="layui-icon"></i>上传视频</button>', '<input type="text" name="video" value="' + e.target.src + '" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" class="layui-input">', "</li>", '<li class="layui-form-item" style="position: relative">', '<button type="button" class="layui-btn" id="LayEdit_InsertImage" style="width: 110px;position: relative;z-index: 10;"> <i class="layui-icon"></i>上传封面</button>', '<input type="text" name="cover" value="' + e.target.poster + '" placeholder="请选择文件" style="position: absolute;width: 100%;padding-left: 120px;left: 0;top:0" class="layui-input">', "</li>", d, "</ul>"].join(""),
                            btn: ["确定", "取消", '<span style="color:red">删除</span>'],
                            btnAlign: "c",
                            yes: function (e, i) {
                                var l = i.find('input[name="video"]'), a = i.find('input[name="cover"]'),
                                    o = i.find('select[name="theme"]');
                                if ("" == l.val()) n.msg("请选择一个视频或输入视频地址"); else {
                                    var d = '&nbsp;<video src="' + l.val() + '" poster="' + a.val() + '" controls="controls" >您的浏览器不支持video播放</video>&nbsp;',
                                        r = "";
                                    s.video.title.length > 0 && o.length > 0 && (r = o[0].options[o[0].selectedIndex].value), h.call(t, "div", {
                                        text: d,
                                        class: r
                                    }, range), n.close(e)
                                }
                            },
                            btn2: function (t, e) {
                            },
                            btn3: function (t, a) {
                                var s = l.calldel;
                                "" != s.url ? i.post(s.url, {
                                    filepath: e.target.src,
                                    imgpath: e.target.poster
                                }, function (t) {
                                    o.remove(), s.done(t)
                                }) : e.toElement.remove(), n.close(t)
                            },
                            success: function (t, e) {
                                layui.use("upload", function (e) {
                                    var i, a = t.find('input[name="video"]'), o = t.find('input[name="cover"]'),
                                        e = layui.upload, d = l.uploadImage || {}, r = l.uploadVideo || {};
                                    e.render({
                                        elem: "#LayEdit_InsertImage",
                                        url: d.url,
                                        field: d.field,
                                        accept: d.accept,
                                        acceptMime: d.acceptMime,
                                        exts: d.exts,
                                        size: d.size,
                                        before: function (t) {
                                            i = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                        },
                                        done: function (t, e, l) {
                                            if (n.close(i), 0 == t.code) t.data = t.data || {}, o.val(t.data.src), d.done(t); else if (2 == t.code) var a = n.open({
                                                type: 1,
                                                anim: 2,
                                                icon: 5,
                                                title: "提示",
                                                area: ["390px", "260px"],
                                                offset: "t",
                                                content: t.msg + "<div><img src='" + t.data.src + "' style='max-height:100px'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                                btn: ["确定", "取消"],
                                                yes: function () {
                                                    t.data = t.data || {}, o.val(t.data.src), n.close(a)
                                                }
                                            }); else n.msg(t.msg || "上传失败")
                                        }
                                    }), e.render({
                                        elem: "#LayEdit_InsertVideo",
                                        url: r.url,
                                        field: r.field,
                                        accept: r.accept,
                                        acceptMime: r.acceptMime,
                                        exts: r.exts,
                                        size: r.size,
                                        before: function (t) {
                                            i = n.msg("文件上传中,请稍等哦", {icon: 16, shade: .3, time: 0})
                                        },
                                        done: function (t, e, l) {
                                            if (n.close(i), 0 == t.code) t.data = t.data || {}, a.val(t.data.src), r.done(t); else if (2 == t.code) var o = n.open({
                                                type: 1,
                                                anim: 2,
                                                icon: 5,
                                                title: "提示",
                                                area: ["390px", "260px"],
                                                offset: "t",
                                                content: t.msg + "<div><video src='" + t.data.src + "' style='max-height:100px' controls='controls'/></div><p style='text-align:center'>确定使用该文件吗？</p>",
                                                btn: ["确定", "取消"],
                                                yes: function () {
                                                    t.data = t.data || {}, a.val(t.data.src), n.close(o)
                                                }
                                            }); else n.msg(t.msg || "上传失败")
                                        }
                                    });
                                    var c = t.find('select[name="theme"]');
                                    s.video.title.length > 0 && c.length > 0 && t.find('select[name="theme"]').on("change mouseover", function () {
                                        n.tips("<img src='" + c[0].options[c[0].selectedIndex].attributes["data-img"].value + "' />", this)
                                    })
                                })
                            }
                        });
                        break;
                    case "TD":
                        g = n.open({
                            type: 1,
                            title: !1,
                            shade: 0,
                            offset: [e.clientY + "px", e.clientX + "px"],
                            skin: "layui-box layui-util-face",
                            content: function () {
                                return '<ul class="layui-clear" style="width: max-content;">' + [, '<li  style="float: initial;width:100%;"><a type="button"  style="width:100%" lay-command="addnewtr"> 新增行 </a></li>', '<li  style="float: initial;width:100%;"><a type="button" style="width:100%" lay-command="deltr"> 删除行 </a></li>'].join("") + "</ul>"
                            }(),
                            success: function (t, e) {
                                t.find("a").on("click", function () {
                                    var t = i(this), l = t.attr("lay-command");
                                    if (l) switch (l) {
                                        case "deltr":
                                            o.remove();
                                            break;
                                        case "addnewtr":
                                            for (var a = "<tr>", s = 0; s < o.children.length; s++) a += "<td></td>";
                                            a += "</tr>", i(o).after(a)
                                    }
                                    n.close(e)
                                })
                            }
                        });
                        break;
                    default:
                        g = n.open({
                            type: 1,
                            title: !1,
                            closeBtn: !1,
                            offset: function () {
                                return /mobile/i.test(navigator.userAgent) ? "auto" : [e.clientY + parent.document.getElementsByClassName("layui-layedit")[0].getBoundingClientRect().y + "px", function () {
                                    var t = e.clientX;
                                    return t + 100 + 30 > parent.document.getElementsByClassName("layui-layedit")[0].getBoundingClientRect().width && (t = t - 100 - 30), t + "px"
                                }]
                            }(),
                            shade: function () {
                                return /mobile/i.test(navigator.userAgent) ? .1 : 0
                            },
                            shadeClose: !0,
                            content: ["<style>", "ul.context-menu > li > a{border: none;border-bottom: 1px solid rgba(0,0,0,.2);border-radius: 0}", "ul.context-menu > li > a:hover{border-color: rgba(0,0,0,.2);background:#eaeaea}", "ul.context-menu > li:last-child > a{border: none;}", "</style>", '<ul style="width:100px" class="context-menu">', '<li><a type="button" class="layui-btn layui-btn-primary layui-btn-sm" style="width:100%" lay-command="left"> 居左 </a></li>', '<li><a type="button" class="layui-btn layui-btn-primary layui-btn-sm" style="width:100%" lay-command="center"> 居中 </a></li>', '<li><a type="button" class="layui-btn layui-btn-primary layui-btn-sm" style="width:100%" lay-command="right"> 居右 </a></li>', '<li><a type="button" class="layui-btn layui-btn-primary layui-btn-sm context-menu-delete" style="width:100%" lay-command="right"> 删除 </a></li>', "</ul>"].join(""),
                            success: function (t, s) {
                                var d = l.calldel;
                                t.find(".layui-btn-primary").on("click", function () {
                                    var t = i(this), e = t.attr("lay-command");
                                    e && ("VIDEO" == a.tagName ? o.style = "text-align:" + e : a.style = "text-align:" + e), n.close(s)
                                }), t.find(".context-menu-delete").on("click", function () {
                                    "BODY" == a.tagName ? n.msg("不能再删除了") : "VIDEO" == a.tagName ? "" != d.url ? i.post(d.url, {
                                        filepath: e.target.src,
                                        imgpath: e.target.poster
                                    }, function (t) {
                                        o.remove(), d.done(t)
                                    }) : o.remove() : "IMG" == a.tagName && "" != d.url ? i.post(d.url, {para: e.target.src}, function (t) {
                                        a.remove(), d.done(t)
                                    }) : a.remove(), n.close(s)
                                })
                            }
                        })
                }
            }
        };
        if (/mobile/i.test(navigator.userAgent)) {
            var C;
            d.on({
                touchstart: function (t) {
                    C = setTimeout(function () {
                        A(t), clearTimeout(C)
                    }, 300), t.preventDefault()
                }, touchmove: function () {
                    clearTimeout(C)
                }, touchend: function () {
                    clearTimeout(C)
                }
            })
        } else d.on("contextmenu", function (t) {
            return A(t), !1
        })
    }, v = function t(e, a) {
        var o = e.dmode, s = this, d = n.open({
            type: 1,
            id: "LAY_layedit_link",
            area: function () {
                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 460 ? ["90%"] : ["460px"]
            }(),
            offset: function () {
                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
            }(),
            shade: .05,
            shadeClose: !0,
            moveType: 1,
            title: "超链接",
            skin: "layui-layer-msg",
            content: ['<ul class="layui-form" style="margin: 15px;">', '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 70px;">链接地址</label>', '<div class="layui-input-block">', '<input name="url" value="' + (e.href || "") + '" autofocus="true" autocomplete="off" class="layui-input">', "</div>", "</li>", '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 70px;">链接文本</label>', '<div class="layui-input-block">', '<input name="text" value="' + (e.text || "") + '" autofocus="true" autocomplete="off" class="layui-input">', "</div>", "</li>", '<li class="layui-form-item ' + (o ? "" : "layui-hide") + '">', '<label class="layui-form-label" style="width: 70px;">打开方式</label>', '<div class="layui-input-block">', '<input type="radio" name="target" value="_blank" class="layui-input" title="新窗口" ' + ("_blank" !== e.target && e.target ? "" : "checked") + ">", '<input type="radio" name="target" value="_self" class="layui-input" title="当前窗口"' + ("_self" === e.target ? "checked" : "") + ">", "</div>", "</li>", '<li class="layui-form-item ' + (o ? "" : "layui-hide") + '">', '<label class="layui-form-label" style="width: 70px;">rel属性</label>', '<div class="layui-input-block">', '<input type="radio" name="rel" value="nofollow" class="layui-input" title="nofollow"' + ("nofollow" !== e.rel && e.target ? "" : "checked") + ">", '<input type="radio" name="rel" value="" class="layui-input" title="无" ' + ("" === e.rel ? "checked" : "") + ">", "</div>", "</li>", '<button type="button" lay-submit lay-filter="layedit-link-yes" id="layedit-link-yes" class="layui-btn" style="display: none;"> 确定 </button>', "</ul>"].join(""),
            btn: ["确定", "取消"],
            btnAlign: "c",
            yes: function (t, e) {
                i("#layedit-link-yes").click()
            },
            btn1: function (t, e) {
                n.close(t), setTimeout(function () {
                    s.focus()
                }, 10)
            },
            success: function (e, i) {
                l.render("radio"), l.on("submit(layedit-link-yes)", function (e) {
                    n.close(t.index), a && a(e.field)
                })
            }
        });
        t.index = d
    }, x = function t(e, a) {
        var o = n.open({
            type: 1,
            id: "LAY_layedit_customlink",
            area: function () {
                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 350 ? ["90%"] : ["350px"]
            }(),
            offset: function () {
                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
            }(),
            shade: .05,
            shadeClose: !0,
            moveType: 1,
            title: e.title,
            skin: "layui-layer-msg",
            content: ['<ul class="layui-form" style="margin: 15px;">', '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 60px;">名称</label>', '<div class="layui-input-block" style="margin-left: 90px">', '<input name="text" value="" autofocus="true" autocomplete="off" class="layui-input">', "</div>", "</li>", '<li class="layui-form-item" style="display:none">', '<button type="button" lay-submit lay-filter="layedit-link-yes" id="layedit-link-yes"> 确定 </button>', "</li>", "</ul>"].join(""),
            btn: ["确定", "取消"],
            btnAlign: "c",
            yes: function (t, e) {
                i("#layedit-link-yes").click()
            },
            success: function (e, i) {
                l.render("radio"), l.on("submit(layedit-link-yes)", function (e) {
                    a && a(e.field), n.close(t.index)
                })
            }
        });
        t.index = o
    }, b = function t(e, a) {
        var o = n.open({
            type: 1,
            id: "LAY_layedit_addmd",
            area: function () {
                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 350 ? ["90%"] : ["350px"]
            }(),
            offset: function () {
                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
            }(),
            shade: .05,
            shadeClose: !0,
            moveType: 1,
            title: "添加锚点",
            skin: "layui-layer-msg",
            content: ['<ul class="layui-form" style="margin: 15px;">', '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 60px;">名称</label>', '<div class="layui-input-block" style="margin-left: 90px">', '<input name="text" value="' + (e.name || "") + '" autofocus="true" autocomplete="off" class="layui-input">', "</div>", "</li>", '<button type="button" lay-submit lay-filter="layedit-link-yes" id="layedit-link-yes" class="layui-btn" style="display: none;"> 确定 </button>', "</ul>"].join(""),
            btn: ["确定", "取消"],
            btnAlign: "c",
            yes: function (t, e) {
                i("#layedit-link-yes").click()
            },
            success: function (e, i) {
                l.render("radio"), l.on("submit(layedit-link-yes)", function (e) {
                    n.close(t.index), a && a(e.field)
                })
            }
        });
        t.index = o
    }, _ = function t(l) {
        return /mobile/i.test(navigator.userAgent) ? t.index = n.open({
            type: 1,
            title: !1,
            closeBtn: 0,
            shade: .05,
            shadeClose: !0,
            content: '<div style="padding: 5px;border: 1px solid #e6e6e6;"><span id="laytable_label" class="layui-label">0列 x 0行</span><table class="layui-table" lay-size="sm"><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table ></div></div > ',
            area: ["85%"],
            skin: "layui-box layui-util-face",
            success: function (t, a) {
                t.find("td").on("touchmove", function (n) {
                    var l = e(n);
                    if (null != l && "TD" === l.tagName.toUpperCase()) {
                        t.find("#laytable_label")[0].innerText = l.cellIndex + 1 + "列X" + (l.parentElement.rowIndex + 1) + "行", t.find("td").removeAttr("style"), i(l).attr("style", "background-color:linen;"), i(l).prevAll().attr("style", "background-color:linen;");
                        for (var a = 0; a < i(l.parentElement).prevAll().length; a++) for (var o = 0; o < i(l.parentElement).prevAll()[a].childNodes.length; o++) o <= l.cellIndex && (i(l.parentElement).prevAll()[a].children[o].style = "background-color:linen;")
                    }
                }), t.find("td").on("touchend", function (t) {
                    var i = e(t);
                    null != i && "TD" === i.tagName.toUpperCase() && (l && l({
                        cells: i.cellIndex + 1,
                        rows: i.parentElement.rowIndex
                    }), n.close(a))
                })
            }
        }) : t.index = n.tips('<div style="padding: 5px;border: 1px solid #e6e6e6;"><span id="laytable_label" class="layui-label">0列 x 0行</span><table class="layui-table" lay-size="sm"><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr style="height: 20px;"><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table ></div></div > ', this, {
            tips: 1,
            time: 0,
            skin: "layui-box layui-util-face",
            maxWidth: 500,
            success: function (e, a) {
                e.find("td").on("mouseover", function () {
                    e.find("#laytable_label")[0].innerText = this.cellIndex + 1 + "列X" + (this.parentElement.rowIndex + 1) + "行", e.find("td").removeAttr("style"), i(this).attr("style", "background-color:linen;"), i(this).prevAll().attr("style", "background-color:linen;");
                    for (var t = 0; t < i(this.parentElement).prevAll().length; t++) for (var n = 0; n < i(this.parentElement).prevAll()[t].childNodes.length; n++) n <= this.cellIndex && (i(this.parentElement).prevAll()[t].children[n].style = "background-color:linen;")
                }), e.find("td").on("click", function () {
                    l && l({cells: this.cellIndex + 1, rows: this.parentElement.rowIndex}), n.close(a)
                }), i(document).off("click", t.hide).on("click", t.hide)
            }
        })
    }, T = function t(e) {
        var l = function () {
            var t = ["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"],
                e = {};
            return layui.each(t, function (t, i) {
                e[i] = layui.cache.dir + "images/face/" + t + ".gif"
            }), e
        }();
        return t.hide = t.hide || function (e) {
            "face" !== i(e.target).attr("layedit-event") && n.close(t.index)
        }, /mobile/i.test(navigator.userAgent) ? t.index = n.open({
            type: 1,
            title: !1,
            closeBtn: 0,
            shade: .05,
            shadeClose: !0,
            content: function () {
                var t = [];
                return layui.each(l, function (e, i) {
                    t.push('<li title="' + e + '"><img src="' + i + '" alt="' + e + '"/></li>')
                }), '<ul class="layui-clear" style="width: 279px;">' + t.join("") + "</ul>"
            }(),
            skin: "layui-box layui-util-face",
            success: function (t, i) {
                t.find(".layui-clear>li").on("click", function () {
                    e && e({src: l[this.title], alt: this.title}), n.close(i)
                })
            }
        }) : t.index = n.tips(function () {
            var t = [];
            return layui.each(l, function (e, i) {
                t.push('<li title="' + e + '"><img src="' + i + '" alt="' + e + '"/></li>')
            }), '<ul class="layui-clear" style="width: 279px;">' + t.join("") + "</ul>"
        }(), this, {
            tips: 1, time: 0, skin: "layui-box layui-util-face", maxWidth: 500, success: function (a, o) {
                a.css({marginTop: -4, marginLeft: -10}).find(".layui-clear>li").on("click", function () {
                    e && e({src: l[this.title], alt: this.title}), n.close(o)
                }), i(document).off("click", t.hide).on("click", t.hide)
            }
        })
    }, k = function t(e) {
        var l = function () {
            var t = ["#fff", "#000", "#800000", "#ffb800", "#1e9fff", "#5fb878", "#ff5722", "#999999", "#01aaed", "#cc0000", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585", "#00babd", "#ff7800"],
                e = {};
            return layui.each(t, function (t, i) {
                e[i] = i
            }), e
        }();
        return t.hide = t.hide || function (e) {
            "colorpicker" == i(e.target).attr("layedit-event") || "fontBackColor" == i(e.target).attr("layedit-event") || n.close(t.index)
        }, /mobile/i.test(navigator.userAgent) ? t.index = n.open({
            type: 1,
            title: !1,
            closeBtn: 0,
            shade: .05,
            shadeClose: !0,
            area: ["auto"],
            content: function () {
                var t = [];
                return layui.each(l, function (e, i) {
                    t.push('<li title="' + i + '" style="background-color:' + i + '"><span style="background-' + i + '" alt="' + e + '"/></li>')
                }), '<ul class="layui-clear" style="width: 279px;">' + t.join("") + "</ul>"
            }(),
            skin: "layui-box layui-util-face",
            success: function (t, i) {
                t.find(".layui-clear>li").on("click", function () {
                    e && e(this.title), n.close(i)
                })
            }
        }) : t.index = n.tips(function () {
            var t = [];
            return layui.each(l, function (e, i) {
                t.push('<li title="' + i + '" style="background-color:' + i + '"><span style="background-' + i + '" alt="' + e + '"/></li>')
            }), '<ul class="layui-clear" style="width: 279px;">' + t.join("") + "</ul>"
        }(), this, {
            tips: 1, time: 0, skin: "layui-box layui-util-face", area: ["auto"], success: function (l, a) {
                l.css({marginTop: -4, marginLeft: -10}).find(".layui-clear>li").on("click", function () {
                    e && e(this.title), n.close(a)
                }), i(document).off("click", t.hide).on("click", t.hide)
            }
        })
    }, w = function t(e, l) {
        t.hide = t.hide || function (e) {
            "fontFomatt" !== i(e.target).attr("layedit-event") && n.close(t.index)
        }, t.index = n.tips(function () {
            var t = [];
            return layui.each(e.fonts, function (i, n) {
                t.push('<li title="' + e.fonts[i] + '" style="float: initial;width:100%;"><' + e.fonts[i] + ">" + e.texts[i] + "</" + e.fonts[i] + "></li>")
            }), '<ul class="layui-clear" style="width: max-content;">' + t.join("") + "</ul>"
        }(), this, {
            tips: 1, time: 0, skin: "layui-box layui-util-face", success: function (a, o) {
                a.css({marginTop: -4, marginLeft: -10}).find(".layui-clear>li").on("click", function () {
                    l && l(this.title, e.fonts), n.close(o)
                }), i(document).off("click", t.hide).on("click", t.hide)
            }
        })
    }, E = function t(e, a) {
        var o = ['<li class="layui-form-item objSel">', '<label class="layui-form-label">请选择语言</label>', "<style>#selectCodeLanguage ~ .layui-form-select > dl {max-height: 192px} </style>", '<div class="layui-input-block">', '<select name="lang" id="selectCodeLanguage">', '<option value="JavaScript">JavaScript</option>', '<option value="HTML">HTML</option>', '<option value="CSS">CSS</option>', '<option value="Java">Java</option>', '<option value="PHP">PHP</option>', '<option value="C#">C#</option>', '<option value="Python">Python</option>', '<option value="Ruby">Ruby</option>', '<option value="Go">Go</option>', "</select>", "</div>", "</li>"].join("");
        e.hide && (o = ['<li class="layui-form-item" style="display:none">', '<label class="layui-form-label">请选择语言</label>', '<div class="layui-input-block">', '<select name="lang">', '<option value="' + e.default + '" selected="selected">', e.default, "</option>", "</select>", "</div>", "</li>"].join(""));
        var s = this, d = n.open({
            type: 1,
            id: "LAY_layedit_code",
            area: function () {
                return /mobile/i.test(navigator.userAgent) || i(window).width() <= 650 ? ["90%"] : ["650px"]
            }(),
            offset: function () {
                return /mobile/i.test(navigator.userAgent) ? "auto" : "100px"
            }(),
            shade: .05,
            shadeClose: !0,
            moveType: 1,
            title: "插入代码",
            skin: "layui-layer-msg",
            content: ['<ul class="layui-form layui-form-pane" style="margin: 15px;">', o, '<li class="layui-form-item layui-form-text">', '<label class="layui-form-label">代码</label>', '<div class="layui-input-block">', '<textarea name="code" lay-verify="required" autofocus="true" class="layui-textarea" style="height: 200px;"></textarea>', "</div>", "</li>", '<button type="button" id="layedit-code-yes" lay-submit lay-filter="layedit-code-yes" class="layui-btn" style="display: none"> 确定 </button>', "</ul>"].join(""),
            btn: ["确定", "取消"],
            btnAlign: "c",
            yes: function (t, e) {
                i("#layedit-code-yes").click()
            },
            btn1: function (t, e) {
                n.close(t), s.focus()
            },
            success: function (i, o) {
                l.render("select"), l.on("submit(layedit-code-yes)", function (i) {
                    n.close(t.index), a && a(i.field, e.hide, e.default)
                })
            }
        });
        t.index = d
    }, A = {
        html: '<i class="layui-icon layedit-tool-html" title="HTML源代码"  layedit-event="html"">&#xe64b;</i><span class="layedit-tool-mid"></span>',
        undo: '<i class="layui-icon layedit-tool-undo" title="撤销" lay-command="undo" layedit-event="undo"">&#xe603;</i>',
        redo: '<i class="layui-icon layedit-tool-redo" title="重做" lay-command="redo" layedit-event="redo"">&#xe602;</i>',
        strong: '<i class="layui-icon layedit-tool-b" title="加粗" lay-command="Bold" layedit-event="b"">&#xe62b;</i>',
        italic: '<i class="layui-icon layedit-tool-i" title="斜体" lay-command="italic" layedit-event="i"">&#xe644;</i>',
        underline: '<i class="layui-icon layedit-tool-u" title="下划线" lay-command="underline" layedit-event="u"">&#xe646;</i>',
        del: '<i class="layui-icon layedit-tool-d" title="删除线" lay-command="strikeThrough" layedit-event="d"">&#xe64f;</i>',
        "|": '<span class="layedit-tool-mid"></span>',
        left: '<i class="layui-icon layedit-tool-left" title="左对齐" lay-command="justifyLeft" layedit-event="left"">&#xe649;</i>',
        center: '<i class="layui-icon layedit-tool-center" title="居中对齐" lay-command="justifyCenter" layedit-event="center"">&#xe647;</i>',
        right: '<i class="layui-icon layedit-tool-right" title="右对齐" lay-command="justifyRight" layedit-event="right"">&#xe648;</i>',
        link: '<i class="layui-icon layedit-tool-link" title="插入链接" layedit-event="link"">&#xe64c;</i>',
        unlink: '<i class="layui-icon layedit-tool-unlink layui-disabled" title="清除链接" lay-command="unlink" layedit-event="unlink"" style="font-size:18px">&#xe64d;</i>',
        face: '<i class="layui-icon layedit-tool-face" title="表情" layedit-event="face"" style="font-size:18px">&#xe650;</i>',
        image: '<i class="layui-icon layedit-tool-image" title="图片" layedit-event="image" style="font-size:18px">&#xe64a;<input type="file" name="file"></i>',
        code: '<i class="layui-icon layedit-tool-code" title="插入代码" layedit-event="code" style="font-size:18px">&#xe64e;</i>',
        images: '<i class="layui-icon layedit-tool-images" title="多图上传" layedit-event="images" style="font-size:18px">&#xe634;</i>',
        image_alt: '<i class="layui-icon layedit-tool-image_alt" title="图片" layedit-event="image_alt" style="font-size:18px">&#xe64a;</i>',
        video: '<i class="layui-icon layedit-tool-video" title="插入视频" layedit-event="video" style="font-size:18px">&#xe6ed;</i>',
        fullScreen: '<i class="layui-icon layedit-tool-fullScreen" title="全屏" layedit-event="fullScreen"style="font-size:18px">&#xe638;</i>',
        colorpicker: '<i class="layui-icon layedit-tool-colorpicker" title="字体颜色选择" layedit-event="colorpicker" style="font-size:18px">&#xe66a;</i>',
        fontBackColor: '<i class="layui-icon layedit-tool-fontBackColor" title="字体背景色选择" layedit-event="fontBackColor" style="font-size:18px;">&#xe60f;</i>',
        fontFomatt: '<i class="layui-icon layedit-tool-fontFomatt" title="段落格式" layedit-event="fontFomatt" style="font-size:18px">&#xe639;</i>',
        fontFamily: '<i class="layui-icon layedit-tool-fontFamily" title="字体" layedit-event="fontFamily" style="font-size:18px">&#xe702;</i>',
        addhr: '<i class="layui-icon layui-icon-chart layedit-tool-addhr" title="添加水平线" layedit-event="addhr" style="font-size:18px"></i>',
        anchors: '<i class="layui-icon layedit-tool-anchors" title="添加锚点" layedit-event="anchors" style="font-size:18px">&#xe60b;</i>',
        customlink: '<i class="layui-icon layedit-tool-customlink" title="添加自定义链接" layedit-event="customlink" style="font-size:18px">&#xe606;</i>',
        table: '<i class="layui-icon layedit-tool-table" title="插入表格" layedit-event="table" style="font-size:18px">&#xe62d;</i>',
        help: '<i class="layui-icon layedit-tool-help" title="帮助" layedit-event="help">&#xe607;</i>'
    }, C = new s;
    l.render(), t("layedit", C)
});
